package com.study.service.Impl;

import com.study.dao.UserDao;
import com.study.service.UserService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class UserServiceImpl implements UserService {
	private UserDao userDao;

//	public UserServiceImpl(UserDao userDao) {
//		this.userDao = userDao;
//		System.out.println("public UserServiceImpl(UserDao userDao)");
//	}


	public void setUserDao(UserDao userDao) {
		this.userDao = userDao;
		System.out.println("UserServiceImpl_public void setUserDao(UserDao userDao) ");
	}

	@Override
	public void save() {
//		ApplicationContext applicationContext =
//				new ClassPathXmlApplicationContext("applicationContext.xml");
//		UserDao userDao = (UserDao) applicationContext.getBean("userDao1");
		System.out.println("UserServiceImpl_public void save()");
		userDao.save();
//		System.out.println("this is UserServiceImpl");

	}
}
